package com.gzx.plugin.data.wxjk.sync.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.gzx.plugin.data.wxjk.sync.dao.HksjDao;
import com.gzx.plugin.data.wxjk.sync.pojo.RepayData;
import com.gzx.plugin.data.wxjk.sync.service.HksjService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
@DS("data")
public class HksjServiceImpl implements HksjService {

    private final HksjDao hksjDao;

    public HksjServiceImpl(HksjDao hksjDao) {
        this.hksjDao = hksjDao;
    }

    @Override
    public void save(List<RepayData> repayDataList) {
        log.info("更新当前批次数据到数据库，总数:{}条", repayDataList.size());
        hksjDao.batchSave(repayDataList);
    }
}
